package com.xg.mina;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

public class ConnectCodecFactory implements ProtocolCodecFactory {
    private ConnectEncoder encoder;
    private ConnectDecoder decoder;

    public ConnectCodecFactory() {
        encoder = new ConnectEncoder();
        decoder = new ConnectDecoder();
    }
    @Override
    public ProtocolEncoder getEncoder(IoSession ioSession) throws Exception {
        return encoder;
    }

    @Override
    public ProtocolDecoder getDecoder(IoSession ioSession) throws Exception {
        return decoder;
    }
}
